package com.hjm.security.exception;

import com.hjm.common.core.enums.ResultCode;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 业务异常
 *
 */
@Data
@NoArgsConstructor
public final class ServiceException extends RuntimeException
{
    private static final long serialVersionUID = 1L;

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误提示
     */
    private String message;

//    public ServiceException(String message)
//    {
//        this.message = message;
//    }

    public ServiceException(ResultCode resultCode)
    {
        this.message = resultCode.getMsg();
    }

//    public ServiceException(String message, Integer code)
//    {
//        this.message = message;
//        this.code = code;
//    }
}